class FusersController < ApplicationController
  # GET /fusers
  # GET /fusers.xml
  def index
    @fusers = Fuser.find(:all)

    respond_to do |format|
      format.html # index.html.erb
      format.xml  { render :xml => @fusers }
    end
  end

  # GET /fusers/1
  # GET /fusers/1.xml
  def show
    @fuser = Fuser.find(params[:id])
	@fsets = @fuser.fsets
	@games = Game.find(:all) 
    respond_to do |format|
      format.html # show.html.erb
      format.xml  { render :xml => @fuser }
    end
  end

  # GET /fusers/new
  # GET /fusers/new.xml
  def new
    @fuser = Fuser.new

    respond_to do |format|
      format.html # new.html.erb
      format.xml  { render :xml => @fuser }
    end
  end

  # GET /fusers/1/edit
  def edit
    @fuser = Fuser.find(params[:id])
  end

  # POST /fusers
  # POST /fusers.xml
  def create
    @fuser = Fuser.new(params[:fuser])

    respond_to do |format|
      if @fuser.save
        flash[:notice] = 'Fuser was successfully created.'
        format.html { redirect_to(@fuser) }
        format.xml  { render :xml => @fuser, :status => :created, :location => @fuser }
      else
        format.html { render :action => "new" }
        format.xml  { render :xml => @fuser.errors, :status => :unprocessable_entity }
      end
    end
  end

  # PUT /fusers/1
  # PUT /fusers/1.xml
  def update
    @fuser = Fuser.find(params[:id])

    respond_to do |format|
      if @fuser.update_attributes(params[:fuser])
        flash[:notice] = 'Fuser was successfully updated.'
        format.html { redirect_to(@fuser) }
        format.xml  { head :ok }
      else
        format.html { render :action => "edit" }
        format.xml  { render :xml => @fuser.errors, :status => :unprocessable_entity }
      end
    end
  end

  # DELETE /fusers/1
  # DELETE /fusers/1.xml
  def destroy
    @fuser = Fuser.find(params[:id])
    @fuser.destroy

    respond_to do |format|
      format.html { redirect_to(fusers_url) }
      format.xml  { head :ok }
    end
  end
end
